var Index = require('../app/controllers/index')
var User = require('../app/controllers/user')
var Movie = require('../app/controllers/movie')
var Comment = require('../app/controllers/comment')
var Category = require('../app/controllers/category')


module.exports = function(app){

//Index
app.get('/',Index.index)

//Movie
app.get('/movie/:id',Movie.detail)
app.get('/admin/movie/update/:id',User.signinRequired,User.adminRequired,Movie.update)
app.get('/admin/movie/new',User.signinRequired,User.adminRequired,Movie.new)
app.get('/admin/movie/list',User.signinRequired,User.adminRequired,Movie.list)
app.delete('/admin/movie/list',User.signinRequired,User.adminRequired,Movie.del)
app.post('/admin/movie',User.signinRequired,User.adminRequired,Movie.save)


//User
app.get('/signin',User.showSignin)
app.get('/signup',User.showSignup)
app.post('/user/signup',User.signup)
app.post('/user/signin',User.signin)
app.get('/admin/userlist',User.signinRequired,User.adminRequired,User.list)
app.get('/logout',User.logout)

//Comment
app.post('/user/comment',User.signinRequired,Comment.save)

//category
app.get('/admin/category/new',User.signinRequired,User.adminRequired,Category.new)
app.get('/admin/categorylist',User.signinRequired,User.adminRequired,Category.list)
app.post('/admin/category',User.signinRequired,User.adminRequired,Category.save)

//results
app.get('/results',Index.search)
}













